<extend name="./main"/>
<block name="title">
    <title>qzone后台----说说管理</title>
</block>
<block name="main">
<script src="__PUBLIC__/js/jquery.min.js"></script>

<div class="clear"></div>
<div class="panel">
    <div class="panel-body">
        <ul class="activity-list" id="loglist">
            <li>
                <div class="avatar">
                    <img src="__PUBLIC__{$user.zonedp}" alt="头像">
                </div>
                <div class="activity-desk">
                    <h5><a href="#">{$user.nickname}</a></h5>
                    <p class="text-muted">{$log.ctime|date="Y-m-d H:i:s",###}</p>
                    <p class="text-muted">{$log.content}</p>
                    <div class="album">
                        <volist name="photo" id="vo">
                            <a href="#">
                                <img alt="说说图片" src="__PUBLIC__/uploads/{$vo.path}">
                            </a>
                        </volist>
                    </div>
                    
                    <div class="pull-right tag-social">
                        <a href="{:U('index')}" class="btn btn-share pull-right">返回</a>
                        <a href="javascript:void(0)" class="btn btn-share pull-right action" dataid="{$log.id}" state="{$log['state']}">{$log['state']?'恢复':'删除'}</a>
                    </div>
                    
                </div>

            </li>
        </ul>
    </div>
</div>
<script>
    $('#loglist').on('click','.action',function(){
        debugger;
        var self = $(this);
        var id = self.attr('dataid');
        var state = self.attr('state');
        var url;
        if(state==4){
            url = "{:U('back')}";
        }else{
            url = "{:U('del')}";
        }
        $.ajax({
            type:'POST',
            url:url,
            data:{'id':id},
            datatype:'json',
            success:function(rs){
                if(rs.status == 'success'){
                    self.attr('state',rs.state);
                    self.html(rs.str);
                }else{
                    alert(rs.msg);
                }
            }
        });
    });
</script>

</block>